<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Gym Rat | Edit Routine Entry</title>
</head>
<body>
<jsp:include page="/includes/nav.jsp" />
<h1>Editing routine entry</h1>
<ul>
	<li>If you need to change exercises (beyond changing the
	variations), you will need to delete this entry and add another.</li>
	<li>If you need to add a variation not listed here, you will have
	to <a
		href="<c:url value='/exercise/info?id=${entry.exerciseId}&redir=/routine/editEntry?routineid=${routineid }%26%2338;entryid=${entry.id }' />">Edit
	the exercise</a>, if you have permission.</li>
</ul>
<form
	action="${pageContext.request.contextPath}/routine/editEntrySubmit"
	name="editForm" method="post"><br>
<table>
	<tr>
		<td>Muscle Group:</td>
		<td>${entry.muscleGroup }</td>
	</tr>
	<tr>
		<td>Exercise:</td>
		<td>${entry.exercise }</td>
	</tr>
	<tr>
		<td>Variations:</td>
	</tr>
	<c:forEach var="var" items="${variations}">
		<tr>
			<td></td>
			<c:set var="contains" value="false" />
			<c:forEach var="item" items="${entry.variations}">
				<c:if test="${item.key eq var.id}">
					<c:set var="contains" value="true" />
				</c:if>
			</c:forEach>
			<td><input type="checkbox" name="variation" value="${var.id }"
				<c:if test="${contains == true}">
				checked=" yes"
				</c:if> />
			${var.name }</td>
		</tr>
	</c:forEach>

	<tr>
		<td>Select the order placement</td>
		<td><input type="text" name="order" size=3
			value="${entry.order }"></td>
		<td>Use identical orders to provide alternative exercises</td>
	</tr>
	<tr>
		<td>Suggested Sets:</td>
		<td><input type="text" name="sets" size=3 value="${entry.sets }"></td>
	</tr>
	<tr>
		<td>Suggested Reps:</td>
		<td><input type="text" name="reps" size=3 value="${entry.reps }"></td>
		<td>Complicated rep structure? Describe it in the notes below</td>
	</tr>
	<tr>
		<td>Note:</td>
		<td colspan=2><textarea rows="3" cols="25" name="notes">${entry.note }</textarea></td>
	</tr>
	<tr>
		<td><input type="button" name="button" value="Update"
			onClick="submit()"></td>
		<td><input type="hidden" name="id" value="${entry.id }">
		<input type="hidden" name="routineid" value="${routineid }"></td>
	</tr>
</table>
</form>
</body>
</html>